package com.ddgame.xiaomiad;

import android.app.Application;
import android.widget.Toast;

import com.xiaomi.ad.mediation.internal.config.IMediationConfigInitListener;
import com.xiaomi.ad.mediation.mimonew.MIMOAdSdkConfig;
import com.xiaomi.ad.mediation.mimonew.MiMoNewSdk;

/**
 * desc   : 模版
 * author : chendaning
 * date   : 1/6/22
 */
public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        MiMoNewSdk.init(getApplicationContext(), "2882303761517973922", getString(com.ddgame.xiaomi.R.string.app_name),
                new MIMOAdSdkConfig.Builder()
                        .setDebug(true)
                        .setStaging(true).build(), new IMediationConfigInitListener() {
                    @Override
                    public void onSuccess() {
                        showToast("mediation config init success");
                    }

                    @Override
                    public void onFailed(int errorCode) {
                        showToast("mediation config init failed");
                    }
                });
    }

    protected void showToast(String text){
        Toast.makeText(this, text,
                Toast.LENGTH_LONG).show();
    }

}
